'''
Created on Jan 19, 2010

@author: madsk
'''

from PyQt4 import QtGui, QtCore
from overlaybutton import OverlayButton

class NextButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(NextButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(NextButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/next.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

        
class PreviousButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(PreviousButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(PreviousButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/previous.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()


class FullScreenButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(FullScreenButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(FullScreenButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        if self.scene().parent()._fullscreen:
            painter.drawPixmap(10, 10, QtGui.QPixmap('icons/windowed.png'))
        else:
            painter.drawPixmap(10, 10, QtGui.QPixmap('icons/fullscreen.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()


class EditButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(EditButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(EditButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/edit.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class MonitorButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(MonitorButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(MonitorButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/monitor.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()
        
class ExitButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(ExitButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(ExitButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/exit.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class SharpenBlurButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(SharpenBlurButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(SharpenBlurButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/sharpen-blur.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class SharpenButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(SharpenButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(SharpenButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/sharpen.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class BlurButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(BlurButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(BlurButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/blur.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class ColorContrastBrightnessButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(ColorContrastBrightnessButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(ColorContrastBrightnessButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/color-contrast-brightness.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class ColorButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(ColorButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(ColorButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/color.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class ContrastButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(ContrastButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(ContrastButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/contrast.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class BrightnessButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(BrightnessButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(BrightnessButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/brightness.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class UndoButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(UndoButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(UndoButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/undo.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class FlipScaleButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(FlipScaleButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(FlipScaleButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/flipscale.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class FlipHorizontalButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(FlipHorizontalButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(FlipHorizontalButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/fliph.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class FlipVerticalButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(FlipVerticalButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(FlipVerticalButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/flipv.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()

class ScaleButton(OverlayButton):
    def __init__(self, parent=None, scene=None):
        super(ScaleButton, self).__init__(parent, scene)
        
    def paint(self, painter, option, widget=None):
        super(ScaleButton, self).paint(painter, option, widget)
        
        # Paint button specific graphics.
        painter.drawPixmap(10, 10, QtGui.QPixmap('icons/scale.png'))
        
    def mousePressEvent(self, event):
        self.clicked.emit()
